home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: Manuel Hernandez <ManuelHe@ix.netcom.com>
- Newsgroups: comp.lang.c++
- Subject: resetting a character array
- Date: 8 Feb 1996 04:09:36 GMT
- Organization: Netcom
- Message-ID: <4fbt20$4o3@cloner3.netcom.com>
- NNTP-Posting-Host: irv-ca15-08.ix.netcom.com
- X-NETCOM-Date: Wed Feb 07 8:09:37 PM PST 1996
-
- This must be a total beginners question. How do you reset
- a character array so you can enter a string into a variable
- over and over again? This is what I have so far.
-
- void main()
- {
- char name[20];
- char answer;
-
- do
- {
- cout << "Enter a name" << endl;
- cin.getline(name,20);
-
- cout << name << " is a nice name. Enter another? " << endl;
- cin >> answer;
-
- }
- while (answer == 'y');
- return;
- }
-
-